package com.bk.ouat.common;

import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class JsonResponseMaker {
	
	@Autowired
	private CommonProperties commProp;
	

	@SuppressWarnings("unchecked")
	public String sucessCode() {
		JSONObject json = new JSONObject();
		json.put(commProp.getCode(), commProp.getOkCode());
		json.put(commProp.getCodeMsg(), commProp.getOkCodeMsg());
		return json.toJSONString();
	}
	
	@SuppressWarnings("unchecked")
	public String notFoundCode() {
		JSONObject json = new JSONObject();
		json.put(commProp.getCode(), commProp.getNotFountCode());
		return json.toJSONString();
	}
	
	@SuppressWarnings("unchecked")
	public String serviceErrorCode() {
		JSONObject json = new JSONObject();
		json.put(commProp.getCode(), commProp.getRequestErrorCode());
		return json.toJSONString();
	}

}
